<?php
class FixDateHelper extends AppHelper{
function fix_date($date, $format = NULL) {

$date = explode(' ', $date);
if ($format == "time"){
	$time = explode(':', $date[1]);
	$time = $time[0] . ":" . $time[1];
}
$date = explode('-', $date[0]);


$year = $date[0];
$month = $date[1];
$day = $date[2];

if ($format == "short") {
switch($month) {
	case 1: $month = "jan"; break;
	case 2: $month = "feb"; break;
	case 3: $month = "maa"; break;
	case 4: $month = "apr"; break;
	case 5: $month = "mei"; break;
	case 6: $month = "jun"; break;
	case 7: $month = "jul"; break;
	case 8: $month = "aug"; break;
	case 9: $month = "sep"; break;
	case 10: $month = "okt"; break;
	case 11: $month = "nov"; break;
	case 12: $month = "dec"; break;
	default: $month = "non";
	}
}else{
	switch($month) {
		case 1: $month = "januari"; break;
		case 2: $month = "februari"; break;
		case 3: $month = "maart"; break;
		case 4: $month = "april"; break;
		case 5: $month = "mei"; break;
		case 6: $month = "juni"; break;
		case 7: $month = "juli"; break;
		case 8: $month = "augustus"; break;
		case 9: $month = "september"; break;
		case 10: $month = "oktober"; break;
		case 11: $month = "november"; break;
		case 12: $month = "december"; break;
		default: $month = "Geen maand";
	}
}

if ($format == "time") {
$date = $day . " " . $month . ", " . $time . " uur";
}else{
$date = $day . " " . $month . " " . $year;
}
return $date;

}
}
?>